<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head>
<title>Resource Compiler (resourcecompiler.exe)</title>
<link rel="stylesheet" type="text/css" href="../rotor.css">
</head>
<body>		

<h1>Resource Compiler (resourcecompiler.exe)</h1>

 
<p>This resource compiler is used to generate platform-independent string 
resource files for use by the unmanaged portion of the Shared Source CLI 2.0 (SSCLI) and 
supporting unmanaged tools.&nbsp; This tool is not intended for use with 
managed applications.&nbsp; </p>

 
<p>Resourcecompiler.exe is functionally similar to the Microsoft&reg; Win32 SDK resource 
compiler, Rc.exe but is considerably simplified. Resourcecompiler.exe 
parses Win32-formatted *.rc files and creates UTF8-encoded text files with the .satellite 
extension rather than producing Win32 binary *.res files like rc.exe.</p>

 
<p>This tool only handles STRINGTABLE resources, not Win32 icons, bitmaps, 
dialog boxes, or other non-string Microsoft&reg; Windows&reg; resource formats.</p>

 
<h4>
Usage</h4>

 
<blockquote>

 
<PRE class="syntax"><b>resourcecompiler</b> <i>[options] inputfile</i></PRE>

 
</blockquote>

 
<table border=1 width="90%">

<TR VALIGN="top">
<TH width=33%>Argument</TH>
<TH width=67%>Description</TH>
</TR>

<TR VALIGN="top">
<TD width=33%>inputfile</TD>
<TD width=67%>Name of file to be compiled to a .satellite resource</TD>
</TR>
</table>


<h4>Options</h4>

 
<table border=1 width="90%">

<TR VALIGN="top" width=100%>
<TH width=33%>Option</TH>
<TH width=67%>Description</TH>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/?</b></TD>
<TD width=67%>Displays a list of command-line options.<p>When you use this tool on 
UNIX system-based platforms, <b>/?</b> might expand to a filename. Instead simply enter 
the command &quot;resourcecompiler&quot; with no options and the usage text will be 
sent 
to the console.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/d</b> </TD>
<TD width=67%>Defines a symbol for the preprocessor that you can test with the 
ifdef directive</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/fo</b></TD>
<TD width=67%>Renames the output file.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/h</b></TD>
<TD width=67%>Displays a list of command-line options.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/i</b></TD>
<TD width=67%>Searches the specified directory before searching the directories 
specified by the INCLUDE environment variable.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/c</b></TD>
<TD width=67%>Specifies the codepage to be used for resource compilation.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/n</b></TD>
<TD width=67%>Terminates all strings in the string table with nulls.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/r</b></TD>
<TD width=67%>Ignored. Provided for compatibility with existing makefiles.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/l</b></TD>
<TD width=67%>Ignored. Provided for compatibility with existing makefiles.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/z</b></TD>
<TD width=67%>Ignored. Provided for compatibility with existing makefiles.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/u</b></TD>
<TD width=67%>Undefines a symbol for the preprocessor.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/v</b></TD>
<TD width=67%>Displays messages that report on the progress of the compiler.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/w</b></TD>
<TD width=67%>Warns only if the codepage is invalid. The default is an error.</TD>
</TR>

<TR VALIGN="top">
<TD width=33%><b>/x</b></TD>
<TD width=67%>Prevents the resource compiler from checking the INCLUDE 
environment 
variable when searching for header files or resource files.</TD>
</TR>

</table>

 
<h4>Resource Compiler Input</h4>
<p>Resource files used by resourcecompiler.exe can contain: </p>
<ul>
  <li>C/C++ style comments (both &quot;/* ... */&quot; and &quot;//&quot;).</li>
  <li>The predefined macro RC_INVOKED.<ul>
    <li>Note that the C standard __DATE__, __TIME__, __FILE__, __STDC__, and 
    __TIMESTAMP__ macros are not defined.</li>
  </ul>
  </li>
  <li>C/C++ style preprocessor directives - #if, #ifdef, #else, #define, #elif, 
  #ifndef, #include, and #undef.</li>
  <li>One pragma: &quot;#pragma code_page( [DEFAULT|CodePageNum] )&quot;.&nbsp; 
  Note that the 
  number will likely be 1252.</li>
  <li>STRINGTABLE resources of the format:
  <ul>
    <li>STRINGTABLE [optional_statements] { stringID string ... } where optional_statements are zero or more of the following:
    <ul>
      <li>&quot;CHARACTERISTICS dword&quot; - will be ignored.</li>
      <li>&quot;LANGUAGE language,sublanguage&quot; - specifies the language of subsequent 
      text, upto the next LANGUAGE statement. Language and sublanguage are 
      integers - see the  Platform SDK header file winnls.h for the 
      complete list.</li>
      <li>&quot;VERSION dword&quot; - will be ignored.</li>
      <li>&quot;DISCARDABLE&quot; - will be ignored.</li>
    </ul>
    </li>
    <li>StringID is an unsigned 16-bit integer.</li>
    <li>String is one or more strings, enclosed in quotation marks. The string 
    must be no longer than 4097 characters and must occupy a single line in the 
    source file. Double quotes are used to embed a quote character in the 
    string. </li>
  </ul>
  </li>
</ul>
Other resources encountered within resource files should produce an error 
  message.<h4>Resource Compiler Output</h4>
<p>The output of the resource compiler is not a Win32 .res file. Instead, it is 
a text file (ending with the .satellite extension) containing 
stringID/string pairs, with the following constraints: </p>
<ul>
  <li>The pairs must be sorted in ascending order by stringID value.</li>
  <li>The stringID must be encoded in decimal format.</li>
  <li>The string must be converted to UTF8 using the language/sublanguage 
  information specified on the command-line, or in the LANGUAGE keyword, or 
  using the system default.</li>
  <li>There must be one space character between the stringID and string,  the 
  line must end with a carriage return/linefeed pair, and the file must end with 
  an EOF character on a line by itself.</li>
  <li>If the resource file contains no STRINGTABLE resources,  the output 
  file should be empty.</li>
</ul>
<p>The satellite file is a UTF-8 encoded file containing a list of pairs of 
decimal numbers and quoted string pairs, with a  space between. The maximum 
string length is 511 bytes, not including the required quotes.</p>
<p>For example, the following three entries are valid: </p>
<blockquote>
  <p>1 &quot;This is a message&quot;<br>
  2 &quot;This is a message&quot;<br>
  39 &quot;This is<br>
  another message&quot; </p>
</blockquote>
<p>But the following entries are not valid: </p>
<blockquote>
  <p>A &quot;This is a message&quot;<br>
  1 2 </p>
</blockquote>
<h4>Additional Information</h4>
<p>On error (including exceptions from within the tool), the tool will exit with 
a nonzero exit code and delete the output file to ensure any partial output is 
not inadvertently left behind. </p>
<p>The *.satellite files can be read by calling APIs within the PALRT: </p>
<ul>
  <li>PAL_LoadSatelliteResourceW - opens a satellite file. Equivalent to 
  LoadLibrary for conventional Win32 resources.</li>
  <li>PAL_LoadSatelliteStringA/W - retrieves a string from the *.satellite file. 
  Equivalent to LoadStringA/W for conventional Win32 resources.</li>
  <li>PAL_FreeSatelliteResource - closes the satellite file.</li>
</ul>
<p>For more details on these APIs, see <a href="../../palrt/inc/rotor_palrt.h">sscli20/palrt/inc/rotor_palrt.h</a>.</p>

<hr>

<p><i>Copyright (c) 2006 Microsoft Corporation. All rights reserved.</i></p>
</body> 
</html>